package com.maycur.ctrip.dto;

import com.maycur.ctrip.util.Constant;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.format.DateTimeFormat;

import java.util.Date;

/**
 * Created by JoeyXin on 7/5/16.
 */
public class OrderSearchCriteria {
    private String entCode;
    private String eId;
    private Date startDate;
    private Date entDate;

    public OrderSearchCriteria(String entCode, String eId, String startDateStr, String entDateStr) {
        this.entCode = entCode;
        this.eId = eId;

        if(StringUtils.isNotEmpty(startDateStr)) {
            this.startDate = DateTimeFormat.forPattern(Constant.DATE_FORMAT).parseDateTime(startDateStr).toDate();
        }

        if(StringUtils.isNotEmpty(entDateStr)) {
            this.entDate = DateTimeFormat.forPattern(Constant.DATE_FORMAT).parseDateTime(entDateStr).toDate();
        }
    }

    public String getEntCode() {
        return entCode;
    }

    public void setEntCode(String entCode) {
        this.entCode = entCode;
    }

    public String geteId() {
        return eId;
    }

    public void seteId(String eId) {
        this.eId = eId;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEntDate() {
        return entDate;
    }

    public void setEntDate(Date entDate) {
        this.entDate = entDate;
    }
}
